package svgedit.gui.actions;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import svgedit.gui.Frame;

@SuppressWarnings("serial")
public class UndoAction extends AbstractAction {

	Frame frame;
	
    public UndoAction(Frame frame) {
        super("Undo");
        this.frame = frame;
       ;
    }
	
	
	@Override
	public void actionPerformed(ActionEvent e) {
	
		frame.getView().undoManager.undo();
        frame.undoAction.setEnabled(frame.getView().undoManager.canUndo());
        frame.redoAction.setEnabled(frame.getView().undoManager.canRedo());

		frame.getView().repaint();
		}
	

}
